var role = require("../lib/role");
module.exports = {
	prefix: "/admin_comment",
	get: {
		"/list": function() {
			var admin = role.getAdmin(this);
			var query = this.request.query;
			this.body = ResponObj("json", admin.getCommentList(query.num, query.page));
		}
	},
	delete: {
		"/delete_comment/:comment_id": function() {
			var admin = role.getAdmin(this);
			var comment_id = this.params.comment_id;
			var body = this.request.body;
			admin.removeComment(comment_id);
			if (body.back_list) { //以列表信息返回
				this.body = ResponObj("json", admin.getCommentList(body.num, body.page));
			} else {
				this.body = ResponObj("string", "评论删除成功");
			}
		}
	}
}